<docs>
</docs>
<template>
  <div :class="`weui-cell weui-cell_access ${valid === status.REJECTED ? 'weui-cell_warn' : ''}`"
   @click="initPicker">
    <div class="weui-cell__hd">
      <p class="weui-label">{{label}}</p>
    </div>
    <div class="searchTxt">
      <p v-for="(item, n) in arrList" :key="item.gwbm">
        {{item.gwmc}}
      </p>
    </div>
    <input-suggestion ref="inS" :hasInitEvent.sync="hasInitEvent"
     :chooseList.sync="arrList" @update:lableList='upDatelableList'
     :deleteList="deleteList"></input-suggestion>
  </div>
</template>
<script>
import inputSuggestion from 'base/form/searchinput';//显示三个
import { mixinValid } from 'common/mixins/mixins';

export default {
  name: 'position',
  components: { inputSuggestion },
  props: {
    label: String,
    arrList: Array,
    deleteList: Array
  },
  mixins: [mixinValid],
  data() {
    return {
      hasInitEvent: false,
    };
  },
  methods: {
    initPicker() {
      this.hasInitEvent = true;
    },
    upDatelableList(val){
      this.$emit('input', val);
    }
  },
  // watch: {
  //   lableList(val) {
  //     if (this.labelName) {
  //       this.resetValid();
  //       this.$emit('input', val);
  //     }
  //   },
  // }
};
</script>
<style scoped lang="scss">
@import '~common/scss/var.scss';
.weui-label {
  @include label;
}
.text {
  text-align: left;
  flex: 1 1 auto;
  line-height: 1.2;
  color: #000;
  font-size: inherit;
  @include input-text;
}
.searchTxt{
  width: 100%;
  p{
    font-size: $font-size-base;
  }
}
</style>
